package com.asm.DBloader;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class ASM_DB extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "ASM.db";

//***************Table creation(1)**************//
public static final String ASM_TABLE="fASM";	

public static final String ASM_FASM_ID="_Id";
public static final String ASM_ASMCODE="ASMCode";
public static final String ASM_ASMNAME="ASMName";
public static final String ASM_RSMCODE="RSMCode";
public static final String ASM_ASMMOB="ASMMob";
public static final String ASM_ASMTEL="ASMTele";
public static final String ASM_ASMMAIL="ASMEMail";
public static final String ASM_STATUS="Status";
public static final String ASM_ADDUSER="AddUser";
public static final String ASM_ADDDATE="AddDate";
public static final String ASM_ADDMACH="AddMach";
public static final String ASM_RECORDID="RecordId";
public static final String ASM_ASMPREFIX="ASMPreFix";

	

private static final int DATABASE_VERSION = 20;


private static final String CREATE_ASM_TABLE = "create table if not exists " + ASM_TABLE + " ("
		+ ASM_FASM_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
		+ ASM_ASMCODE + " TEXT,"
		+ ASM_ASMNAME + " TEXT,"
		+ ASM_RSMCODE + " TEXT,"
		+ ASM_ASMMOB + " TEXT,"
		+ ASM_ASMTEL + " TEXT,"
		+ ASM_ASMMAIL + " TEXT,"
		+ ASM_STATUS + " TEXT,"
		+ ASM_ADDUSER + " TEXT,"
		+ ASM_ADDDATE + " TEXT,"
		+ ASM_ADDMACH + " TEXT,"
		+ ASM_RECORDID + " TEXT,"
		+ ASM_ASMPREFIX + " TEXT); ";

//********************Table creation(2)****************//
public static final String ASM_SERVER_DETAILS="serverinfo";
public static final String ASM_SERVER_ID="_Id";
public static final String ASM_SERVERURL="serverurl";
public static final String ASM_PORT="portval";
public static final String ASM_SERVERDBNAME="serverdbname";
public static final String ASM_ACTIVEPORTS="activeproperty";

private static final String CREATE_ASM_SERVER_DETAILS = "create table if not exists " + ASM_SERVER_DETAILS + " ("
		+ ASM_SERVER_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
		+ ASM_SERVERURL + " TEXT,"
		+ ASM_PORT + " TEXT,"
		+ ASM_SERVERDBNAME + " TEXT,"
		+ ASM_ACTIVEPORTS + " TEXT); ";



//*****************Table creation(3)******************//

public static final String ASM_DBLIST="serverdb";
public static final String ASM_SERVERDBLIST_ID="_Id";
public static final String ASM_DBNAME="dbname";

private static final String CREATE_ASM_DBLIST = "create table if not exists " + ASM_DBLIST + " ("
		+ ASM_SERVERDBLIST_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
		+ ASM_DBNAME + " TEXT); ";

//*****************Table Creation(4)******************//
public static final String ASM_FORDDET="FOrddet";
public static final String asmDET_ID ="_ID";
public static final String asmDET_RefNo ="RefNo";
public static final String asmDET_TxnDate="TxnDate";
public static final String asmDET_TxnType="TxnType";
public static final String asmDET_SeqNo="SeqNo";
public static final String asmDET_Itemcode="Itemcode";
public static final String asmDET_Txnseqno="Txnseqno";
public static final String asmDET_SellPrice="SellPrice";
public static final String asmDET_BSellPrice="BSellPrice";
public static final String asmDET_TSellPrice="TSellPrice";
public static final String asmDET_BTSellPrice="BTSellPrice";
public static final String asmDET_CostPrice="CostPrice";
public static final String asmDET_CaseQty="CaseQty";
public static final String asmDET_PiceQty="PiceQty";
public static final String asmDET_Type="Type";
public static final String asmDET_Qty="Qty";
public static final String asmDET_BalQty="BalQty";
public static final String asmDET_DisPer="DisPer";
public static final String asmDET_DisAmt="DisAmt";
public static final String asmDET_BDisAmt="BDisAmt";
public static final String asmDET_TaxAmt="TaxAmt";
public static final String asmDET_BTaxAmt="BTaxAmt";
public static final String asmDET_Amt="Amt";
public static final String asmDET_BAmt="BAmt";
public static final String asmDET_ReaCode="ReaCode";
public static final String asmDET_RecordId="RecordId";
public static final String asmDET_DisPerAmt="DisPerAmt";
public static final String asmDET_DisValAmt="DisValAmt";
public static final String asmDET_FrIss="FrIss";

private static final String CREATE_ASM_FORDDET = "create table if not exists " + ASM_FORDDET + " ("
		
		+ asmDET_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
		+ asmDET_RefNo + " TEXT,"
		+ asmDET_TxnDate + " TEXT,"
		+ asmDET_TxnType + " TEXT,"
		+ asmDET_SeqNo + " TEXT,"
		+ asmDET_Itemcode + " TEXT,"
		+ asmDET_Txnseqno + " TEXT,"
		+ asmDET_SellPrice + " TEXT,"
		+ asmDET_BSellPrice + " TEXT,"
		+ asmDET_TSellPrice + " TEXT,"
		+ asmDET_BTSellPrice + " TEXT,"
		+ asmDET_CostPrice + " TEXT,"
		+ asmDET_CaseQty + " TEXT,"
		+ asmDET_PiceQty + " TEXT,"
		+ asmDET_Type + " TEXT,"
		+ asmDET_Qty + " TEXT,"
		+ asmDET_BalQty + " TEXT,"
		+ asmDET_DisPer + " TEXT,"
		+ asmDET_DisAmt + " TEXT,"
		+ asmDET_BDisAmt + " TEXT,"
		+ asmDET_TaxAmt + " TEXT,"
		+ asmDET_BTaxAmt + " TEXT,"
		+ asmDET_Amt + " TEXT,"
		+ asmDET_BAmt + " TEXT,"
		+ asmDET_ReaCode + " TEXT,"
		+ asmDET_RecordId + " TEXT,"
		+ asmDET_DisPerAmt + " TEXT,"
		+ asmDET_DisValAmt + " TEXT,"
		+ asmDET_FrIss + " TEXT); ";

//*****************Table Creation(5)******************//
	public static final String ASM_FORDHED="FOrdHed";
	public static final String asmHED_ID =" _ID";
	public static final String asmHED_RefNo =" RefNo";
	public static final String asmHED_TxnDate = "TxnDate" ;
	public static final String asmHED_ManuRef= "ManuRef";
	public static final String asmHED_DelvDate="DelvDate";
	public static final String asmHED_DealCode="DealCode";
	public static final String asmHED_RepCode="RepCode";
	public static final String asmHED_AreaCode="AreaCode";
	public static final String asmHED_RouteCode="RouteCode";
	public static final String asmHED_DebCode="DebCode";
	public static final String asmHED_LocCode="LocCode";
	public static final String asmHED_Remarks="Remarks";
	public static final String asmHED_CostCode="CostCode";
	public static final String asmHED_CurCode="CurCode";
	public static final String asmHED_CurRate="CurRate";
	public static final String asmHED_TxnType="TxnType";
	public static final String asmHED_InvAmt="InvAmt";
	public static final String asmHED_OutDis="OutDis";
	public static final String asmHED_InvDis="InvDis";
	public static final String asmHED_TotMkrAmt="TotMkrAmt";
	public static final String asmHED_UnOvAmt="UnOvAmt";
	public static final String asmHED_TotalDis="TotalDis";
	public static final String asmHED_TotalItmDis="TotalItmDis";
	public static final String asmHED_TotalAmt="TotalAmt";
	public static final String asmHED_AddUser="AddUser";
	public static final String asmHED_AddDate="AddDate";
	public static final String asmHED_AddMach="AddMach";
	public static final String asmHED_InvFlg="InvFlg";
	public static final String asmHED_prtcopy="prtcopy";
	public static final String asmHED_RecordId="RecordId";
	public static final String asmHED_TranBatch="TranBatch";
	public static final String asmHED_OutDisVal="OutDisVal";
	public static final String asmHED_Longitude="Longitude";
	public static final String asmHED_Latitude="Latitude";
	public static final String asmHED_startTimeSO="startTimeSO";
	public static final String asmHED_endTimeSO="endTimeSO";
	public static final String asmHED_address="address";
	public static final String asmHED_clssts="clssts";
	public static final String asmHED_refno2="refno2";
	public static final String asmHED_PayType="PayType";
	public static final String asmHED_Skutype="Skutype";
	public static final String asmHED_DiffDate="DiffDate";

	private static final String CREATE_ASM_FORDHED = "create table if not exists " + ASM_FORDHED + " ("
			+ asmHED_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmHED_RefNo+ " TEXT, "
			+ asmHED_TxnDate + " TEXT,"
			+ asmHED_ManuRef + " TEXT,"
			+ asmHED_DelvDate + " TEXT,"
			+ asmHED_DealCode + " TEXT,"
			+ asmHED_RepCode + " TEXT,"
			+ asmHED_AreaCode + " TEXT,"
			+ asmHED_RouteCode + " TEXT,"
			+ asmHED_DebCode + " TEXT,"
			+ asmHED_LocCode + " TEXT,"
			+ asmHED_Remarks + " TEXT,"
			+ asmHED_CostCode + " TEXT,"
			+ asmHED_CurCode + " TEXT,"
			+ asmHED_CurRate + " TEXT,"
			+ asmHED_TxnType + " TEXT,"
			+ asmHED_InvAmt + " TEXT,"
			+ asmHED_OutDis + " TEXT,"
			+ asmHED_InvDis + " TEXT,"
			+ asmHED_TotMkrAmt + " TEXT,"
			+ asmHED_UnOvAmt + " TEXT,"
			+ asmHED_TotalDis + " TEXT,"
			+ asmHED_TotalItmDis + " TEXT,"
			+ asmHED_TotalAmt + " TEXT,"
			+ asmHED_AddUser + " TEXT,"
			+ asmHED_AddDate + " TEXT,"
			+ asmHED_AddMach + " TEXT,"
			+ asmHED_InvFlg + " TEXT,"
			+ asmHED_prtcopy + " TEXT,"
			+ asmHED_RecordId + " TEXT,"
			+ asmHED_TranBatch + " TEXT,"
			+ asmHED_OutDisVal + " TEXT,"
			+ asmHED_Longitude + " TEXT,"
			+ asmHED_Latitude + " TEXT,"
			+ asmHED_startTimeSO + " TEXT,"
			+ asmHED_endTimeSO + " TEXT,"
			+ asmHED_address + " TEXT,"
			+ asmHED_clssts + " TEXT,"
			+ asmHED_refno2 + " TEXT,"
			+ asmHED_PayType + " TEXT,"
			+ asmHED_Skutype + " TEXT,"
			+ asmHED_DiffDate + " TEXT); ";



//*****************Table Creation(6)******************//

	public static final String ASM_FROUTE = "fRoute";
	public static final String asmFR_ID = "_ID";
	public static final String asmFR_RouteCode = "RouteCode";
	public static final String asmFR_RouteName = "RouteName";
	public static final String asmFR_Status = "Status";
	public static final String asmFR_RepCode = "RepCode";
	public static final String asmFR_AreaCode = "AreaCode";
	public static final String asmFR_DealCode = "DealCode";
	public static final String asmFR_Km= "Km";
	public static final String asmFR_MinProcall= "MinProcall";
	public static final String asmFR_RDAloRate= "RDAloRate";
	public static final String asmFR_Tonnage= "Tonnage";
	public static final String asmFR_Remarks= "Remarks";
	public static final String asmFR_RDTarget= "RDTarget";
	public static final String asmFR_FreqNo= "FreqNo";
	public static final String asmFR_AddUser= "AddUser";
	public static final String asmFR_AddDate= "AddDate";
	public static final String asmFR_AddMach= "AddMach";
	public static final String asmFR_RecordId= "RecordId";
	
	private static final String CREATE_ASM_FROUTE = "create table if not exists " + ASM_FROUTE + " ("
			+ asmFR_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFR_RouteCode+ " TEXT, "
			+ asmFR_RouteName + " TEXT,"
			+ asmFR_Status + " TEXT,"
			+ asmFR_RepCode + " TEXT,"
			+ asmFR_AreaCode + " TEXT,"
			+ asmFR_DealCode + " TEXT,"
			+ asmFR_Km + " TEXT,"
			+ asmFR_MinProcall + " TEXT,"
			+ asmFR_RDAloRate + " TEXT,"
			+ asmFR_Tonnage + " TEXT,"
			+ asmFR_Remarks + " TEXT,"
			+ asmFR_RDTarget + " TEXT,"
			+ asmFR_FreqNo + " TEXT,"
			+ asmFR_AddUser + " TEXT,"
			+ asmFR_AddDate + " TEXT,"
			+ asmFR_AddMach + " TEXT,"
			+ asmFR_RecordId + " TEXT); ";

	
	
	
//*****************Table Creation(7)******************//

	
	public static final String ASM_FAREA = "fArea";
	public static final String asmAr_ID = "_ID";
	public static final String asmAr_AreaCode = "AreaCode";
	public static final String asmAr_AreaName = "AreaName";
	public static final String asmAr_RegCode = "RegCode";
	public static final String asmAr_DealCode = "DealCode";

	
	private static final String CREATE_ASM_FAREA = "create table if not exists " + ASM_FAREA + " ("
			+ asmAr_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmAr_AreaCode + " TEXT,"
			+ asmAr_AreaName + " TEXT,"
			+ asmAr_RegCode + " TEXT,"
			+ asmAr_DealCode + " TEXT); ";
	
	
	
	
//*****************Table Creation(8)******************//

	
	public static final String ASM_FLOCATION = "fLocation";
	public static final String asmLoc_ID = "_ID";
	public static final String asmLoc_LocCode = "LocCode";
	public static final String asmLoc_LocName = "LocName";
	public static final String asmLoc_TeleNo = "TeleNo";
	public static final String asmLoc_FaxNo = "FaxNo";
	public static final String asmLoc_EMail = "EMail";
	public static final String asmLoc_LoctCode = "LoctCode";
	public static final String asmLoc_RepCode = "RepCode";
	public static final String asmLoc_Contact = "Contact";
	public static final String asmLoc_Address1 = "Address1";
	public static final String asmLoc_Address2 = "Address2";
	public static final String asmLoc_Address3 = "Address3";
	public static final String asmLoc_AddUser = "AddUser";
	public static final String asmLoc_AddDate = "AddDate";
	public static final String asmLoc_AddMach = "AddMach";
	public static final String asmLoc_RecordId = "RecordId";
	
	
	
	
	private static final String CREATE_ASM_FLOCATION = "create table if not exists " + ASM_FLOCATION + " ("
			+ asmLoc_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmLoc_LocCode + " TEXT,"
			+ asmLoc_LocName + " TEXT,"
			+ asmLoc_TeleNo + " TEXT,"
			+ asmLoc_FaxNo + " TEXT,"
			+ asmLoc_EMail + " TEXT,"
			+ asmLoc_LoctCode + " TEXT,"
			+ asmLoc_RepCode + " TEXT,"
			+ asmLoc_Contact + " TEXT,"
			+ asmLoc_Address1 + " TEXT,"
			+ asmLoc_Address2 + " TEXT,"
			+ asmLoc_Address3 + " TEXT,"
			+ asmLoc_AddUser + " TEXT,"
			+ asmLoc_AddDate + " TEXT,"
			+ asmLoc_AddMach + " TEXT,"
			+ asmLoc_RecordId + " TEXT); ";
//*****************Table Creation(9)******************//

	
	public static final String ASM_FINVHED = "FinvHed";
	public static final String asmInvHed_ID = "_ID";
	public static final String asmInvHed_RefNo = "RefNo";
	public static final String asmInvHed_RefNo1 = "RefNo1";
//	public static final String asmInvHed_InvType = "InvType";
	public static final String asmInvHed_TxnDate = "TxnDate";
//	public static final String asmInvHed_ManuRef = "ManuRef";
	public static final String asmInvHed_DealCode = "DealCode";
	public static final String asmInvHed_RepCode = "RepCode";
	public static final String asmInvHed_AreaCode = "AreaCode";
//	public static final String asmInvHed_RouteCode = "RouteCode";
	public static final String asmInvHed_DebCode = "DebCode";
//	public static final String asmInvHed_LocCode = "LocCode";
//	public static final String asmInvHed_Remarks = "Remarks";
//	public static final String asmInvHed_CostCode = "CostCode";
//	public static final String asmInvHed_CurCode = "CurCode";
//	public static final String asmInvHed_CurRate = "CurRate";
//	public static final String asmInvHed_TxnType = "TxnType";
//	public static final String asmInvHed_InvAmt = "InvAmt";
//	public static final String asmInvHed_OutDis = "OutDis";
//	public static final String asmInvHed_InvDis = "InvDis";
//	public static final String asmInvHed_TotMkrAmt = "TotMkrAmt";
//	public static final String asmInvHed_UnOvAmt = "UnOvAmt";
//	public static final String asmInvHed_TotalDis = "TotalDis";
//	public static final String asmInvHed_TotalItmDis = "TotalItmDis";
	public static final String asmInvHed_TotalAmt = "TotalAmt";
//	public static final String asmInvHed_AddUser = "AddUser";
	public static final String asmInvHed_AddDate = "AddDate";
//	public static final String asmInvHed_AddMach = "AddMach";
//	public static final String asmInvHed_prtcopy = "prtcopy";
//	public static final String asmInvHed_RecordId = "RecordId";
//	public static final String asmInvHed_TranBatch = "TranBatch";
//	public static final String asmInvHed_Longitude = "Longitude";
//	public static final String asmInvHed_Latitude = "Latitude";
//	public static final String asmInvHed_OutDisVal = "OutDisVal";
//	public static final String asmInvHed_startTimeIN = "startTimeIN";
//	public static final String asmInvHed_endTimeIN = "endTimeIN";
//	public static final String asmInvHed_refno2 = "refno2";
//	public static final String asmInvHed_DeliDate = "DeliDate";

	
	private static final String CREATE_ASM_FINVHED = "create table if not exists " + ASM_FINVHED + " ("
			+ asmInvHed_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmInvHed_RefNo + " TEXT,"
			+ asmInvHed_RefNo1 + " TEXT,"
			+ asmInvHed_TxnDate + " TEXT,"
			+ asmInvHed_DealCode + " TEXT,"
			+ asmInvHed_RepCode + " TEXT,"
			
			+ asmInvHed_AreaCode + " TEXT,"
			+ asmInvHed_DebCode + " TEXT,"
			+ asmInvHed_TotalAmt + " TEXT,"
			+ asmInvHed_AddDate + " TEXT); ";
	
	
	
	
//*****************Table Creation(10)******************//
	public static final String ASM_FINVDET = "FinvDet";
	public static final String asmInvDet_ID = "_ID";
	public static final String asmInvDet_RefNo = "RefNo";
	public static final String asmInvDet_TxnDate = "TxnDate";
	public static final String asmInvDet_TxnType= "TxnType";
	public static final String asmInvDet_SeqNo = "SeqNo";
	public static final String asmInvDet_Itemcode = "Itemcode";
	public static final String asmInvDet_Txnseqno = "Txnseqno";
	public static final String asmInvDet_SellPrice = "SellPrice";
	public static final String asmInvDet_BSellPrice = "BSellPrice";
	public static final String asmInvDet_TSellPrice = "TSellPrice";
	public static final String asmInvDet_BTSellPrice = "BTSellPrice";
	public static final String asmInvDet_CostPrice = "CostPrice";
	public static final String asmInvDet_CaseQty = "CaseQty";
	public static final String asmInvDet_Type = "Type";
	public static final String asmInvDet_PiceQty = "PiceQty";
	public static final String asmInvDet_Qty = "Qty";
	public static final String asmInvDet_BalQty = "BalQty";
	public static final String asmInvDet_DisPer = "DisPer";
	public static final String asmInvDet_DisAmt = "DisAmt";
	public static final String asmInvDet_BDisAmt = "BDisAmt";
	public static final String asmInvDet_TaxAmt = "TaxAmt";
	public static final String asmInvDet_BTaxAmt = "BTaxAmt";
	public static final String asmInvDet_Amt = "Amt";
	public static final String asmInvDet_BAmt = "BAmt";
	public static final String asmInvDet_ReaCode = "ReaCode";
	public static final String asmInvDet_Linkrec = "Linkrec";
	public static final String asmInvDet_RecordId = "RecordId";
	public static final String asmInvDet_DisPerAmt = "DisPerAmt";
	public static final String asmInvDet_DisValAmt = "DisValAmt";
	public static final String asmInvDet_FrIss = "FrIss";
	public static final String asmInvDet_RetBalQty = "RetBalQty";
	public static final String asmInvDet_RetBalCQty = "RetBalCQty";
	public static final String asmInvDet_RetBalPQty = "RetBalPQty";
	public static final String asmInvDet_deliBalQty = "deliBalQty";
	public static final String asmInvDet_delists = "delists";

	

	
	private static final String CREATE_ASM_FINVDET = "create table if not exists " + ASM_FINVDET + " ("
			+ asmInvDet_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmInvDet_RefNo + " TEXT,"
			+ asmInvDet_TxnDate + " TEXT,"
			+ asmInvDet_TxnType + " TEXT,"
			+ asmInvDet_SeqNo + " TEXT,"
			+ asmInvDet_Itemcode + " TEXT,"
			+ asmInvDet_Txnseqno + " TEXT,"
			+ asmInvDet_SellPrice + " TEXT,"
			+ asmInvDet_BSellPrice + " TEXT,"
			+ asmInvDet_TSellPrice + " TEXT,"
			+ asmInvDet_BTSellPrice + " TEXT,"
			+ asmInvDet_CostPrice + " TEXT,"
			+ asmInvDet_CaseQty + " TEXT,"
			+ asmInvDet_Type + " TEXT,"
			+ asmInvDet_PiceQty + " TEXT,"
			+ asmInvDet_Qty + " TEXT,"
			+ asmInvDet_BalQty + " TEXT,"
			+ asmInvDet_DisPer + " TEXT,"
			+ asmInvDet_DisAmt + " TEXT,"
			+ asmInvDet_BDisAmt + " TEXT,"
			+ asmInvDet_TaxAmt + " TEXT,"
			+ asmInvDet_BTaxAmt + " TEXT,"
			+ asmInvDet_Amt + " TEXT,"
			+ asmInvDet_BAmt + " TEXT,"
			+ asmInvDet_ReaCode + " TEXT,"
			+ asmInvDet_Linkrec + " TEXT,"
			+ asmInvDet_RecordId + " TEXT,"
			+ asmInvDet_DisPerAmt + " TEXT,"
			+ asmInvDet_DisValAmt + " TEXT,"
			+ asmInvDet_FrIss + " TEXT,"
			+ asmInvDet_RetBalQty + " TEXT,"
			+ asmInvDet_RetBalCQty + " TEXT,"
			+ asmInvDet_RetBalPQty + " TEXT,"
			+ asmInvDet_deliBalQty + " TEXT,"
			+ asmInvDet_delists + " TEXT); ";
//*****************Table Creation(11)******************//
	public static final String ASM_FINVFREEISS = "fInvFreeIss";
	public static final String asmFreeIss_ID = "_ID";
	public static final String asmFreeIss_RefNo = "RefNo";
	public static final String asmFreeIss_TxnDate = "TxnDate";
	public static final String asmFreeIss_RefNo1 = "RefNo1";
	public static final String asmFreeIss_itemcode = "itemcode";
	public static final String asmFreeIss_Qty = "Qty";
	public static final String asmFreeIss_RecordId = "RecordId";
	
	private static final String CREATE_ASM_FINVFREEISS = "create table if not exists " + ASM_FINVFREEISS + " ("
			+ asmFreeIss_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFreeIss_RefNo + " TEXT,"
			+ asmFreeIss_TxnDate + " TEXT,"
			+ asmFreeIss_RefNo1 + " TEXT,"
			+ asmFreeIss_itemcode + " TEXT,"
			+ asmFreeIss_Qty + " TEXT,"
			+ asmFreeIss_RecordId + " TEXT); ";
	
//*****************Table Creation(12)******************//
	public static final String ASM_FDEBTOR = "fDebtor";
	public static final String asmFdebtor_ID = "_ID";
	public static final String asmFdebtor_DebCode = "DebCode";
	public static final String asmFdebtor_DebName = "DebName";
	public static final String asmFdebtor_AreaCode = "AreaCode";
	public static final String asmFdebtor_DealCode= "DealCode";
	public static final String asmFdebtor_RepCode = "RepCode";
	public static final String asmFdebtor_OutCode = "OutCode";
	public static final String asmFdebtor_AreaName = "AreaName";

	

	
	private static final String CREATE_ASM_FDEBTOR = "create table if not exists " + ASM_FDEBTOR + " ("
			+ asmFdebtor_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFdebtor_DebCode + " TEXT,"
			+ asmFdebtor_DebName + " TEXT,"
			+ asmFdebtor_AreaCode + " TEXT,"
			+ asmFdebtor_DealCode + " TEXT,"
			+ asmFdebtor_RepCode + " TEXT,"
			+ asmFdebtor_OutCode + " TEXT,"
			+ asmFdebtor_AreaName + " TEXT); ";
//*****************Table Creation(13)******************//
	public static final String ASM_FPROVINCE = "fProvince";
	public static final String asmFProvince_ID = "_ID";
	public static final String asmFProvince_ProvCode = "ProvCode";
	public static final String asmFProvince_ProvName = "ProvName";
	public static final String asmFProvince_CntryCode = "CntryCode";
	public static final String asmFProvince_AddUser = "AddUser";
	public static final String asmFProvince_AddDate = "AddDate";
	public static final String asmFProvince_AddMach = "AddMach";
	public static final String asmFProvince_RecordId = "RecordId";
	
	
	private static final String CREATE_ASM_FPROVINCE = "create table if not exists " + ASM_FPROVINCE + " ("
			+ asmFProvince_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFProvince_ProvCode + " TEXT,"
			+ asmFProvince_ProvName + " TEXT,"
			+ asmFProvince_CntryCode + " TEXT,"
			+ asmFProvince_AddUser + " TEXT,"
			+ asmFProvince_AddDate + " TEXT,"
			+ asmFProvince_AddMach + " TEXT,"
			+ asmFProvince_RecordId + " TEXT); ";
//*****************Table Creation(14)******************//
	
	public static final String ASM_FDAYNPRDHED = "FDaynPrdHed";
	public static final String asmFnonHed_ID = "_ID";
	public static final String asmFnonHed_RefNo = "RefNo";
	public static final String asmFnonHed_TxnDate = "TxnDate";
	public static final String asmFnonHed_DealCode = "DealCode";
	public static final String asmFnonHed_RepCode = "RepCode";
	public static final String asmFnonHed_Remarks = "Remarks";
	public static final String asmFnonHed_CostCode = "CostCode";
	public static final String asmFnonHed_AddUser = "AddUser";
	public static final String asmFnonHed_AddDate = "AddDate";
	public static final String asmFnonHed_AddMach = "AddMach";
	public static final String asmFnonHed_RecordId = "RecordId";
	public static final String asmFnonHed_TranBatch = "TranBatch";
	public static final String asmFnonHed_Longitude = "Longitude";
	public static final String asmFnonHed_Latitude = "Latitude";
	public static final String asmFnonHed_Issynced = "Syncstate";
	public static final String asmFnonHed_Address = "Address";
	

	
	
	private static final String CREATE_ASM_FDAYNPRDHED = "create table if not exists " + ASM_FDAYNPRDHED + " ("
			+ asmFProvince_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFnonHed_RefNo + " TEXT,"
			+ asmFnonHed_TxnDate + " TEXT,"
			+ asmFnonHed_DealCode + " TEXT,"
			+ asmFnonHed_RepCode + " TEXT,"
			+ asmFnonHed_Remarks + " TEXT,"
			+ asmFnonHed_CostCode + " TEXT,"
			+ asmFnonHed_AddUser + " TEXT,"
			+ asmFnonHed_AddDate + " TEXT,"
			+ asmFnonHed_AddMach + " TEXT,"
			+ asmFnonHed_RecordId + " TEXT,"
			+ asmFnonHed_TranBatch + " TEXT,"
			+ asmFnonHed_Longitude + " TEXT,"
			+ asmFnonHed_Latitude + " TEXT,"
			+ asmFnonHed_Issynced + " TEXT,"
			+ asmFnonHed_Address + " TEXT); ";
//*****************Table Creation(15)******************//
	public static final String ASM_FDAYNPRDDET = "fDaynPrdDet";
	public static final String asmFnonDet_ID = "_ID";
	public static final String asmFnonDet_RefNo = "RefNo";
	public static final String asmFnonDet_TxnDate = "TxnDate";
	public static final String asmFnonDet_DebCode = "DebCode";
	public static final String asmFnonDet_Reason = "Reason";
	public static final String asmFnonDet_RecordId = "RecordId";
	public static final String asmFnonDet_Longitude = "Longitude";
	public static final String asmFnonDet_Latitude = "Latitude";
	public static final String asmFnonDet_RepCode = "RepCode";
	public static final String asmFnonDet_Teratory = "Teratory";
	public static final String asmFnonDet_Syncstate = "Syncstate";
	
	
	
	
	
	private static final String CREATE_ASM_FDAYNPRDDET = "create table if not exists " + ASM_FDAYNPRDDET + " ("
			+ asmFnonDet_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFnonDet_RefNo + " TEXT,"
			+ asmFnonDet_TxnDate + " TEXT,"
			+ asmFnonDet_DebCode + " TEXT,"
			+ asmFnonDet_Reason + " TEXT,"
			+ asmFnonDet_RecordId + " TEXT,"
			+ asmFnonDet_Longitude + " TEXT,"
			+ asmFnonDet_Latitude + " TEXT,"
			+ asmFnonDet_RepCode + " TEXT,"
			+ asmFnonDet_Teratory + " TEXT,"
			+ asmFnonDet_Syncstate + " TEXT); ";
//*****************Table Creation(16)******************//
	public static final String ASM_FDAYEXPDET = "FDayExpDet";
	public static final String asmDExpDet_ID = "_ID";
	public static final String asmDExpDet_RefNo = "RefNo";
	public static final String asmDExpDet_TxnDate = "TxnDate";
	public static final String asmDExpDet_SeqNo = "SeqNo";
	public static final String asmDExpDet_ExpCode = "ExpCode";
	public static final String asmDExpDet_ExpName= "ExpName";
	public static final String asmDExpDet_Amt = "Amt";
	public static final String asmDExpDet_RecordId = "RecordId";


	
	private static final String CREATE_ASM_FDAYEXPDET = "create table if not exists " + ASM_FDAYEXPDET + " ("
			+ asmDExpDet_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmDExpDet_RefNo + " TEXT,"
			+ asmDExpDet_TxnDate + " TEXT,"
			+ asmDExpDet_SeqNo + " TEXT,"
			+ asmDExpDet_ExpCode + " TEXT,"
			+ asmDExpDet_ExpName + " TEXT,"
			+ asmDExpDet_Amt + " TEXT,"
			+ asmDExpDet_RecordId + " TEXT); ";
	
	
	
	//*****************Table Expense Header******************//
		public static final String ASM_FDAYEXPHED = "FDayExpHed";
		public static final String asmDExpHed_ID = "_ID";
		public static final String asmDExpHed_RefNo = "RefNo";
		public static final String asmDExpHed_TxnDate = "TxnDate";
		public static final String asmDExpHed_RepName = "RepName";
		public static final String asmDExpHed_DealCode = "DealCode";
		public static final String asmDExpHed_CostCode = "CostCode";
		public static final String asmDExpHed_RepCode = "RepCode";
		public static final String asmDExpHed_RegCode = "RegCode";
		public static final String asmDExpHed_AreaCode = "AreaCode";
		public static final String asmDExpHed_Remarks = "Remarks";
		public static final String asmDExpHed_AddUser = "AddUser";
		public static final String asmDExpHed_AddDate = "AddDate";
		public static final String asmDExpHed_AddMach= "AddMach";
		public static final String asmDExpHed_Longitide = "Longitude";
		public static final String asmDExpHed_Latitude = "Latitude";
		public static final String asmDExpHed_Issynced = "Syncstate";
		public static final String asmDExpHed_RecordId = "RecordId";
		public static final String asmDExpHed_Address = "Address";
		



		
		private static final String CREATE_ASM_FDAYEXPHED = "create table if not exists " + ASM_FDAYEXPHED + " ("
				+ asmDExpHed_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
				+ asmDExpHed_RefNo + " TEXT,"
				+ asmDExpHed_TxnDate + " TEXT,"
				+ asmDExpHed_RepName + " TEXT,"
				+ asmDExpHed_DealCode + " TEXT,"
				+ asmDExpHed_CostCode + " TEXT,"
				+ asmDExpHed_RepCode + " TEXT,"
				+ asmDExpHed_RegCode + " TEXT,"
				+ asmDExpHed_AreaCode + " TEXT,"
				+ asmDExpHed_Remarks + " TEXT,"
				+ asmDExpHed_AddUser + " TEXT,"
				+ asmDExpHed_AddDate + " TEXT,"
				+ asmDExpHed_AddMach + " TEXT,"
				+ asmDExpHed_Longitide + " TEXT,"
				+ asmDExpHed_Latitude + " TEXT,"
				+ asmDExpHed_Issynced + " TEXT,"
				+ asmDExpHed_RecordId + " TEXT); ";
		
//*****************Table Creation(17)******************//
	public static final String ASM_FEXPENCES = "fExpense";
	public static final String asmFexpen_ID = "_ID";
	public static final String asmFexpen_ExpCode = "ExpCode";
	public static final String asmFexpen_ExpName = "ExpName";
	public static final String asmFexpen_ExpGrpCode = "ExpGrpCode";
	public static final String asmFexpen_Status = "Status";
	public static final String asmFexpen_AddUser = "AddUser";
	public static final String asmFexpen_AddDate = "AddDate";
	
	public static final String asmFexpen_AddMach = "AddMach";
	public static final String asmFexpen_RecordId = "RecordId";



	
	private static final String CREATE_ASM_FEXPENCES = "create table if not exists " + ASM_FEXPENCES + " ("
			+ asmFexpen_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFexpen_ExpCode + " TEXT,"
			+ asmFexpen_ExpName + " TEXT,"
			+ asmFexpen_ExpGrpCode + " TEXT,"
			+ asmFexpen_Status + " TEXT,"
			+ asmFexpen_AddUser + " TEXT,"
			+ asmFexpen_AddDate + " TEXT,"
			+ asmFexpen_AddMach + " TEXT,"
			+ asmFexpen_RecordId + " TEXT); ";

//*****************Table Creation(18)******************//
	public static final String ASM_FSALREP = "fSalRep";
	public static final String asmFsalrep_ID = "_ID";
	public static final String asmFsalrep_RepCode = "RepCode";
	public static final String asmFsalrep_RepName = "RepName";
	public static final String asmFsalrep_RepMob = "RepMob";
	public static final String asmFsalrep_RepTele = "RepTele";
	public static final String asmFsalrep_RepEMail = "RepEMail";
	public static final String asmFsalrep_RepTCode = "RepTCode";
	public static final String asmFsalrep_RepPreFix = "RepPreFix";
	public static final String asmFsalrep_ASECode = "ASECode";
	public static final String asmFsalrep_Status = "Status";
	public static final String asmFsalrep_AreaCode = "AreaCode";
	public static final String asmFsalrep_DealCode = "DealCode";
	public static final String asmFsalrep_SalesFlg = "SalesFlg";
	public static final String asmFsalrep_CashFlot = "CashFlot";
	public static final String asmFsalrep_EPFNo = "EPFNo";
	public static final String asmFsalrep_AddUser = "AddUser";
	public static final String asmFsalrep_AddDate = "AddDate";
	public static final String asmFsalrep_AddMach = "AddMach";
	public static final String asmFsalrep_RecordId = "RecordId";




	
	private static final String CREATE_ASM_FSALREP = "create table if not exists " + ASM_FSALREP + " ("
			+ asmFsalrep_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFsalrep_RepCode + " TEXT,"
			+ asmFsalrep_RepName + " TEXT,"
			+ asmFsalrep_RepMob + " TEXT,"
			+ asmFsalrep_RepTele + " TEXT,"
			+ asmFsalrep_RepEMail + " TEXT,"
			+ asmFsalrep_RepTCode + " TEXT,"
			+ asmFsalrep_RepPreFix + " TEXT,"
			+ asmFsalrep_ASECode + " TEXT,"
			+ asmFsalrep_Status + " TEXT,"
			+ asmFsalrep_AreaCode + " TEXT,"
			+ asmFsalrep_DealCode + " TEXT,"
			+ asmFsalrep_SalesFlg + " TEXT,"
			+ asmFsalrep_CashFlot + " TEXT,"
			+ asmFsalrep_EPFNo + " TEXT,"
			+ asmFsalrep_AddUser + " TEXT,"
			+ asmFsalrep_AddDate + " TEXT,"
			+ asmFsalrep_AddMach + " TEXT,"
			+ asmFsalrep_RecordId + " TEXT); ";
//*****************Table Creation(19)******************//
	public static final String ASM_FDEALER = "fDealer";
	public static final String asmFdealer_ID = "_ID";
	public static final String asmFdealer_DealCode = "DealCode";
	public static final String asmFdealer_DealName = "DealName";
//	public static final String asmFdealer_DealAdd1 = "DealAdd1";
//	public static final String asmFdealer_DealAdd2 = "DealAdd2";
//	public static final String asmFdealer_DealAdd3 = "DealAdd3";
//	public static final String asmFdealer_DealTele = "DealTele";
//	public static final String asmFdealer_DealEMail = "DealEMail";
//	
//	public static final String asmFdealer_DealMob = "DealMob";
//	public static final String asmFdealer_Status = "Status";
//	public static final String asmFdealer_Distance = "Distance";
//	public static final String asmFdealer_DealGdCode = "DealGdCode";
//	public static final String asmFdealer_CusTypCode = "CusTypCode";
//	public static final String asmFdealer_AddUser = "AddUser";
//	
//	public static final String asmFdealer_AddDate = "AddDate";
//	public static final String asmFdealer_AddMach = "AddMach";
//	public static final String asmFdealer_RecordId = "RecordId";
	



	
	private static final String CREATE_ASM_FDEALER = "create table if not exists " + ASM_FDEALER + " ("
			+ asmFdealer_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFdealer_DealCode + " TEXT,"
			+ asmFdealer_DealName + " TEXT); ";
//*****************Table Creation(20)******************//
	
	public static final String ASM_FREGION = "fRegion";
	public static final String asmFregion_ID = "_ID";
	public static final String asmFregion_RegCode = "RegCode";
	public static final String asmFregion_RegName = "RegName";
	
	public static final String asmFregion_ZoneCode = "ZoneCode";



	
	private static final String CREATE_ASM_FREGION = "create table if not exists " + ASM_FREGION + " ("
			+ asmFregion_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFregion_RegCode + " TEXT,"
			+ asmFregion_RegName + " TEXT,"
			+ asmFregion_ZoneCode + " TEXT); ";
//*****************Table Creation(21)******************//
	
	public static final String ASM_FASE = "fASE";
	public static final String asmFAse_ID = "_ID";
	public static final String asmFAse_ASECode = "ASECode";
	public static final String asmFAse_ASEName = "ASEName";
	public static final String asmFAse_ASMCode = "ASMCode";



	
	private static final String CREATE_ASM_FASE = "create table if not exists " + ASM_FASE + " ("
			+ asmFAse_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFAse_ASECode + " TEXT,"
			+ asmFAse_ASEName + " TEXT,"
			+ asmFAse_ASMCode + " TEXT); ";
//*****************Table Creation(22)******************//
	
	public static final String ASM_FITEMS = "fItems";
	public static final String asmFItems_ID = "_ID";
	public static final String asmFItems_SKUCode = "SKUCode";
	public static final String asmFItems_ItemCode = "ItemCode";
	public static final String asmFItems_ItemName = "ItemName";
	public static final String asmFItems_BrandCode = "BrandCode";
	public static final String asmFItems_NOUCase = "NOUCase";

	private static final String CREATE_ASM_FITEMS = "create table if not exists " + ASM_FITEMS + " ("
			+ asmFItems_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFItems_SKUCode + " TEXT,"
			+ asmFItems_ItemCode + " TEXT,"
			+ asmFItems_ItemName + " TEXT,"
			+ asmFItems_BrandCode + " TEXT,"
			+ asmFItems_NOUCase + " TEXT); ";
//*****************Table Creation(23)******************//
	public static final String ASM_FINVRHED = "fInvrhed";
	public static final String asmInvrhed_ID = "_ID";
	public static final String asmInvrhed_RefNo = "RefNo";
	public static final String asmInvrhed_TxnDate = "TxnDate";
	public static final String asmInvrhed_RefNo1 = "RefNo1";
	public static final String asmInvrhed_TxnType = "TxnType";
	public static final String asmInvrhed_RepCode = "RepCode";
	public static final String asmInvrhed_BTotalAmt = "BTotalAmt";
	public static final String asmInvrhed_DebCode = "DebCode";
	public static final String asmInvrhed_AreaCode = "AreaCode";
	public static final String asmInvrhed_Invflg = "Invflg";
	public static final String asmInvrhed_Remarks = "Remarks";
	public static final String asmInvrhed_LocCode = "LocCode";
	
	

	private static final String CREATE_ASM_FINVRHED = "create table if not exists " + ASM_FINVRHED + " ("
			+ asmInvrhed_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmInvrhed_RefNo + " TEXT,"
			+ asmInvrhed_TxnDate + " TEXT,"
			+ asmInvrhed_RefNo1 + " TEXT,"
			+ asmInvrhed_TxnType + " TEXT,"
			+ asmInvrhed_RepCode + " TEXT,"
			+ asmInvrhed_BTotalAmt + " TEXT,"
			+ asmInvrhed_DebCode + " TEXT,"
			+ asmInvrhed_AreaCode + " TEXT,"
			+ asmInvrhed_Invflg + " TEXT,"
			+ asmInvrhed_Remarks + " TEXT,"
			+ asmInvrhed_LocCode + " TEXT); ";
//*****************Table Creation(22)******************//
	
	public static final String ASM_FINVRDET = "fInvrdet";
	public static final String asmInvrdet_ID = "_ID";
	public static final String asmInvrdet_RefNo = "RefNo";
	public static final String asmInvrdet_TxnDate = "TxnDate";
	public static final String asmInvrdet_TxnType = "TxnType";
	public static final String asmInvrdet_ItemCode = "ItemCode";
	public static final String asmInvrdet_BAmt = "BAmt";
	public static final String asmInvrdet_Type = "Type";
	public static final String asmInvrdet_CaseQty = "CaseQty";
	public static final String asmInvrdet_PiceQty = "PiceQty";
	

	private static final String CREATE_ASM_FINVRDET = "create table if not exists " + ASM_FINVRDET + " ("
			+ asmInvrdet_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmInvrdet_RefNo + " TEXT,"
			+ asmInvrdet_TxnDate + " TEXT,"
			+ asmInvrdet_TxnType + " TEXT,"
			+ asmInvrdet_ItemCode + " TEXT,"
			+ asmInvrdet_BAmt + " TEXT,"
			+ asmInvrdet_Type + " TEXT,"
			+ asmInvrdet_CaseQty + " TEXT,"
			+ asmInvrdet_PiceQty + " TEXT); ";
//*****************Table Creation(23)******************//
	
	public static final String ASM_FITENRDET = "FItenrDet";
	public static final String asmFItenrdet_ID = "_ID";
	public static final String asmFItenrdet_RefNo = "RefNo";
	public static final String asmFItenrdet_TxnDate = "TxnDate";
	public static final String asmFItenrdet_RDTarget = "RDTarget";
	public static final String asmFItenrdet_RouteCode = "RouteCode";

	private static final String CREATE_ASM_FITENRDET = "create table if not exists " + ASM_FITENRDET + " ("
			+ asmFItenrdet_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFItenrdet_RefNo + " TEXT,"
			+ asmFItenrdet_TxnDate + " TEXT,"
			+ asmFItenrdet_RDTarget + " TEXT,"
			+ asmFItenrdet_RouteCode + " TEXT); ";
	//**********************FREASON***********************//
	public static final String ASM_FREASON = "fReason";
	public static final String asmFreason_ID = "_ID";
	public static final String asmFreason_ReaCode = "ReaCode";
	public static final String asmFreason_ReaName = "ReaName";
	public static final String asmFreason_Type = "Type";
	public static final String asmFreason_ReaTcode= "ReaTcode";
	public static final String asmFreason_AddUser = "AddUser";
	public static final String asmFreason_AddDate= "AddDate";
	public static final String asmFreason_AddMach = "AddMach";
	
	private static final String CREATE_ASM_FREASON = "create table if not exists " + ASM_FREASON + " ("
			+ asmFreason_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFreason_ReaCode + " TEXT,"
			+ asmFreason_ReaName + " TEXT,"
			+ asmFreason_Type + " TEXT,"
			+ asmFreason_ReaTcode + " TEXT,"
			+ asmFreason_AddUser + " TEXT,"
			+ asmFreason_AddDate + " TEXT,"
			+ asmFreason_AddMach + " TEXT); ";
	//**********************fCompanySetting***************//
	public static final String ASM_FCOMPANYSETTING = "fCompanySetting";
	public static final String asmfCompanySetting_ID = "_ID";
	public static final String asmfCompanySetting_cSettingsCode = "cSettingsCode";
	public static final String asmfCompanySetting_cSettingGrp = "cSettingGrp";
	public static final String asmfCompanySetting_cLocationChar = "cLocationChar";
	public static final String asmfCompanySetting_cCharVal= "cCharVal";
	public static final String asmfCompanySetting_nNumVal = "nNumVal";
	public static final String asmfCompanySetting_cRemarks= "cRemarks";
	public static final String asmfCompanySetting_nType = "nType";
	public static final String asmfCompanySetting_bUpdateFlag= "bUpdateFlag";
	public static final String asmfCompanySetting_cCompanyCode = "cCompanyCode";
	public static final String asmfCompanySetting_recordid = "recordid";
	
	private static final String CREATE_ASM_FCOMPANYSETTING = "create table if not exists " + ASM_FCOMPANYSETTING + " ("
			+ asmfCompanySetting_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmfCompanySetting_cSettingsCode + " TEXT,"
			+ asmfCompanySetting_cSettingGrp + " TEXT,"
			+ asmfCompanySetting_cLocationChar + " TEXT,"
			+ asmfCompanySetting_cCharVal + " TEXT,"
			+ asmfCompanySetting_nNumVal + " TEXT,"
			+ asmfCompanySetting_cRemarks + " TEXT,"
			+ asmfCompanySetting_nType + " TEXT,"
			+ asmfCompanySetting_bUpdateFlag + " TEXT,"
			+ asmfCompanySetting_cCompanyCode + " TEXT,"
			+ asmfCompanySetting_recordid + " TEXT); ";
	//********************ASM_FCompanyBranchDS************//
	
	public static final String ASM_FCOMPANYBRANCH = "fCompanyBranch";
	public static final String asmFCompanyBranch_ID = "_ID";
	public static final String asmFCompanyBranch_cSettingsCode = "cSettingsCode";
	public static final String asmFCompanyBranch_BranchCode = "BranchCode";
	public static final String asmFCompanyBranch_nNumVal = "nNumVal";
	public static final String asmFCompanyBranch_RecordId = "RecordId";

	private static final String CREATE_ASM_FCOMPANYBRANCH = "create table if not exists " + ASM_FCOMPANYBRANCH + " ("
			+ asmFCompanyBranch_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFCompanyBranch_cSettingsCode + " TEXT,"
			+ asmFCompanyBranch_BranchCode + " TEXT,"
			+ asmFCompanyBranch_nNumVal + " TEXT,"
			+ asmFCompanyBranch_RecordId + " TEXT); ";
	//**********************Usersettings*****************//
	public static final String ASM_USERSETTINGS = "Usersettings";
	public static final String asmUSersettings_ID = "_ID";
	public static final String asmUSersettings_username = "username";
	public static final String asmUSersettings_asmprefix = "asmprefix";
	public static final String asmUSersettings_asmcode = "asmcode";
	public static final String asmUSersettings_serverdbname = "serverdbname";

	private static final String CREATE_ASM_USERSETTINGS = "create table if not exists " + ASM_USERSETTINGS + " ("
			+ asmUSersettings_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmUSersettings_username + " TEXT,"
			+ asmUSersettings_asmprefix + " TEXT,"
			+ asmUSersettings_asmcode + " TEXT,"
			+ asmUSersettings_serverdbname + " TEXT); ";
	//*****************FAVHed*****************************//
	public static final String ASM_FAVHED = "fAvHed";
	public static final String ASM_FAVHED_ID = "_ID";
	public static final String ASM_FAVHED_REFNO = "RefNo";
	public static final String ASM_FAVHED_TXNDATE = "TxnDate";
	//public static final String ASM_FAVHED_DEALCODE = "DebCode";
	public static final String ASM_FAVHED_REMARKS = "Remarks";
	//public static final String ASM_FAVHED_REPCODE = "RepCode";
	public static final String ASM_FAVHED_ADDUSER = "AddUser";
	public static final String ASM_FAVHED_ADDDATE = "AddDate";
	public static final String ASM_FAVHED_ADDMACH = "AddMach";
	public static final String ASM_FAVHED_TERATORY = "Teratory";
	public static final String ASM_FAVHED_ROOT = "Root";//
	public static final String ASM_FAVHED_DEBTOR = "Debtor";
	public static final String ASM_FAVHED_BRAND = "Brand";
	//public static final String ASM_FAVHED_LATITUDE = "Longitude";
	//public static final String ASM_FAVHED_PURCHDATE = "Latitude";
	public static final String ASM_FAVHED_Longitude = "Longitude";
	public static final String ASM_FAVHED_Latitude = "Latitude";
	public static final String ASM_FAVHED_ISSYNCED = "isssynced";

	

	private static final String CREATE_ASM_FAVHED = "create table if not exists " + ASM_FAVHED + " ("
			+ ASM_FAVHED_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ ASM_FAVHED_REFNO + " TEXT,"
			+ ASM_FAVHED_TXNDATE + " TEXT,"
		//	+ ASM_FAVHED_DEALCODE + " TEXT,"
			+ ASM_FAVHED_REMARKS + " TEXT,"
		//	+ ASM_FAVHED_REPCODE + " TEXT,"
			+ ASM_FAVHED_ADDUSER + " TEXT,"
			+ ASM_FAVHED_ADDDATE + " TEXT,"
			+ ASM_FAVHED_ADDMACH + " TEXT,"
			+ ASM_FAVHED_TERATORY + " TEXT,"
			+ ASM_FAVHED_ROOT + " TEXT,"
			+ ASM_FAVHED_DEBTOR + " TEXT,"
			+ ASM_FAVHED_BRAND + " TEXT,"
			+ ASM_FAVHED_Longitude + " TEXT,"
			+ ASM_FAVHED_Latitude + " TEXT,"
			//+ ASM_FAVHED_PURCHDATE + " TEXT,"
			+ ASM_FAVHED_ISSYNCED + " TEXT); ";
	
	//**********************FAVDet***********************//
	public static final String ASM_FAVDET = "fAvDet";
	public static final String ASM_FAVDET_ID = "_ID";
	public static final String ASM_FAVDET_REFNO = "RefNo";
	public static final String ASM_FAVDET_TXNDATE = "TxnDate";
	public static final String ASM_FAVDET_ITEMCODE = "Itemcode";
	public static final String ASM_FAVDET_ITEMNAME = "Itemname";
	
	public static final String ASM_FAVDET_COMPSTATUS = "Cmpstatus";
	public static final String ASM_FAVDET_COMPPROD = "cmpprod";
	public static final String ASM_FAVDET_UITEMS = "Uitems";
	public static final String ASM_FAVDET_USTATUS = "Ustatus";
	public static final String ASM_FAVDET_HITEMS = "Hitems";
	public static final String ASM_FAVDET_HSTATUS = "Hstaus";
	public static final String ASM_FAVDET_VITEMS = "Vitems";
	public static final String ASM_FAVDET_VSTATUS = "Vstatus";
	public static final String ASM_FAVDET_ISSYNCED = "isssynced";
	public static final String ASM_FAVDET_ACTIVESTATE = "activestate";


	private static final String CREATE_ASM_FAVDET = "create table if not exists " + ASM_FAVDET + " ("
			+ ASM_FAVDET_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ ASM_FAVDET_REFNO + " TEXT,"
			+ ASM_FAVDET_TXNDATE + " TEXT,"
			+ ASM_FAVDET_ITEMCODE + " TEXT,"
			+ ASM_FAVDET_ITEMNAME + " TEXT,"
			+ ASM_FAVDET_COMPSTATUS + " TEXT,"
			+ ASM_FAVDET_COMPPROD + " TEXT,"
			+ ASM_FAVDET_UITEMS + " TEXT,"
			+ ASM_FAVDET_USTATUS + " TEXT,"
			+ ASM_FAVDET_HITEMS + " TEXT,"
			+ ASM_FAVDET_HSTATUS + " TEXT,"
			+ ASM_FAVDET_VITEMS + " TEXT,"
			+ ASM_FAVDET_VSTATUS + " TEXT,"
			+ ASM_FAVDET_ISSYNCED + " TEXT,"
			+ ASM_FAVDET_ACTIVESTATE + " TEXT); ";
	//**********************FBrand***********************//
	public static final String ASM_FBRAND = "fBrand";
	public static final String ASM_FBRAND_ID = "_ID";
	public static final String asmFBrand_BrandCode = "BrandCode";
	public static final String asmFBrand_BrandName = "BrandName";
	public static final String asmFBrand_AddUser = "AddUser";
	public static final String asmFBrand_AddDate = "AddDate";
	public static final String asmFBrand_AddMach = "AddMach";
	public static final String asmFBrand_Prefix = "Prefix";
	public static final String asmFBrand_Seqno = "Seqno";
	

	private static final String CREATE_ASM_FBRAND = "create table if not exists " + ASM_FBRAND + " ("
			+ ASM_FBRAND_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFBrand_BrandCode + " TEXT,"
			+ asmFBrand_BrandName + " TEXT,"
			+ asmFBrand_AddUser + " TEXT,"
			+ asmFBrand_AddDate + " TEXT,"
			+ asmFBrand_AddMach + " TEXT,"
			+ asmFBrand_Prefix + " TEXT,"
			+ asmFBrand_Seqno + " TEXT); ";
	//**********************FGroup***********************//
	public static final String ASM_FGROUP = "fGroup";
	public static final String asmFgroup_ID = "_ID";
	public static final String asmFGroup_GroupCode = "GroupCode";
	public static final String asmFGroup_GroupName = "GroupName";

	

	private static final String CREATE_ASM_FGROUP = "create table if not exists " + ASM_FGROUP + " ("
			+ asmFgroup_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFGroup_GroupCode + " TEXT,"
			+ asmFGroup_GroupName + " TEXT); ";
	//**********************FRouteDet********************
	public static final String ASM_FROUTEDET = "fRouteDet";
	public static final String asmFRoutedet_ID = "_ID";
	public static final String asmFRoutedet_RouteCode = "RouteCode";
	public static final String asmFRoutedet_DebCode = "DebCode";

	

	private static final String CREATE_ASM_FROUTEDET = "create table if not exists " + ASM_FROUTEDET + " ("
			+ asmFRoutedet_ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmFRoutedet_RouteCode + " TEXT,"
			+ asmFRoutedet_DebCode + " TEXT); ";
	//***********************AVTemp**********************//
	public static final String ASM_AVTEMP = "fAvtemp";
	public static final String asmavTemp_id = "_ID";
	public static final String asmavTempRefno = "refno";
	public static final String asmavTempItemname = "itemname";
	public static final String asmavTempItemcode = "itemcode";
	public static final String asmavTempBrandcode = "brandcode";
	public static final String asmavTempStatus = "status";
	public static final String asmavTempNewsales = "newsales";
	public static final String asmavTempUitems = "uitems";
	public static final String asmavTempUstatus = "ustatus";
	public static final String asmavTempHitems = "hitems";
	public static final String asmavTempHstatus = "hstatus";
	public static final String asmavTempVitems = "vitems";
	public static final String asmavTempVstatus = "vstatus";
	public static final String asmavTempActivestate = "Activestate";


	

	private static final String CREATE_ASM_AVTEMP = "create table if not exists " + ASM_AVTEMP + " ("
			+ asmavTemp_id+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmavTempRefno + " TEXT,"
			+ asmavTempItemname + " TEXT,"
			+ asmavTempItemcode + " TEXT,"
			+ asmavTempBrandcode + " TEXT,"
			+ asmavTempStatus + " TEXT,"
			+ asmavTempNewsales + " TEXT,"
			+ asmavTempUitems + " TEXT,"
			+ asmavTempUstatus + " TEXT,"
			+ asmavTempHitems + " TEXT,"
			+ asmavTempHstatus + " TEXT,"
			+ asmavTempVitems + " TEXT,"
			+ asmavTempVstatus + " TEXT,"
			+ asmavTempActivestate + " TEXT); ";	
	//*********************EXPTEMP************************//
	
	public static final String ASM_EXPTEMP = "Fexptemp";
	public static final String asmExpTEmp_id = "_ID";
	public static final String asmExpTEmp_RefNo = "refno";
	public static final String asmExpTEmp_ExpName = "expname";
	public static final String asmExpTEmp_ExpCode = "expcode";
	public static final String asmExpTEmp_amunt = "amunt";



	

	private static final String CREATE_ASM_EXPTEMP = "create table if not exists " + ASM_EXPTEMP + " ("
			+ asmExpTEmp_id+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ asmExpTEmp_RefNo + " TEXT,"
			+ asmExpTEmp_ExpName + " TEXT,"
			+ asmExpTEmp_ExpCode + " TEXT,"
			+ asmExpTEmp_amunt + " TEXT); ";
	
	//**********************END***************************//

	

	public ASM_DB(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase mydb) {
		// TODO Auto-generated method stub
		try {
			mydb.execSQL(CREATE_ASM_TABLE);
			mydb.execSQL(CREATE_ASM_SERVER_DETAILS);
			mydb.execSQL(CREATE_ASM_DBLIST);
			mydb.execSQL(CREATE_ASM_FORDDET);
			mydb.execSQL(CREATE_ASM_FORDHED);
			mydb.execSQL(CREATE_ASM_FAREA);
			mydb.execSQL(CREATE_ASM_FLOCATION);
			mydb.execSQL(CREATE_ASM_FINVHED);
			mydb.execSQL(CREATE_ASM_FINVDET);
			mydb.execSQL(CREATE_ASM_FINVFREEISS);
			mydb.execSQL(CREATE_ASM_FDEBTOR);
			mydb.execSQL(CREATE_ASM_FPROVINCE);
			mydb.execSQL(CREATE_ASM_FDAYNPRDHED);
			mydb.execSQL(CREATE_ASM_FDAYNPRDDET);
			mydb.execSQL(CREATE_ASM_FDAYEXPDET);
			mydb.execSQL(CREATE_ASM_FDAYEXPHED);
			mydb.execSQL(CREATE_ASM_FEXPENCES);
			mydb.execSQL(CREATE_ASM_FSALREP);
			mydb.execSQL(CREATE_ASM_FDEALER);
			mydb.execSQL(CREATE_ASM_FREGION);
			mydb.execSQL(CREATE_ASM_FROUTE);  // add inoshi
			mydb.execSQL(CREATE_ASM_FASE);
			mydb.execSQL(CREATE_ASM_FITEMS);
			mydb.execSQL(CREATE_ASM_FINVRHED);
			mydb.execSQL(CREATE_ASM_FINVRDET);
			mydb.execSQL(CREATE_ASM_FITENRDET);
			mydb.execSQL(CREATE_ASM_FREASON);
			mydb.execSQL(CREATE_ASM_FCOMPANYSETTING);
			mydb.execSQL(CREATE_ASM_FCOMPANYBRANCH);
			mydb.execSQL(CREATE_ASM_USERSETTINGS);
			mydb.execSQL(CREATE_ASM_FAVHED);
			mydb.execSQL(CREATE_ASM_FAVDET);
			mydb.execSQL(CREATE_ASM_FBRAND);
			mydb.execSQL(CREATE_ASM_FGROUP);
			mydb.execSQL(CREATE_ASM_FROUTEDET);
			mydb.execSQL(CREATE_ASM_AVTEMP);
			mydb.execSQL(CREATE_ASM_EXPTEMP);
			
			
			
			
			
			

			
			
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_TABLE);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_SERVER_DETAILS);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_DBLIST);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FORDDET );
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FORDHED);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FAREA);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FLOCATION);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FINVHED);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FINVDET);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FINVFREEISS);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FDEBTOR);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FPROVINCE);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FDAYNPRDHED);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FDAYNPRDDET);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FDAYEXPDET);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FDAYEXPHED);
			
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FEXPENCES);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FSALREP);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FDEALER);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FREGION);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FROUTE); // add inoshi
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FASE);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FITEMS);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FINVRHED);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FINVRDET);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FITENRDET);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FREASON);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FCOMPANYSETTING);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FCOMPANYBRANCH);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_USERSETTINGS);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FAVHED);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FAVDET);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FBRAND);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FGROUP);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_FROUTEDET);
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_AVTEMP);
			
			mydb.execSQL("DROP TABLE IF EXISTS " + CREATE_ASM_EXPTEMP);
			
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}

	@Override
	public void onUpgrade(SQLiteDatabase mydb, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		try {
//			mydb.execSQL(CREATE_ASM_TABLE);
//			mydb.execSQL(CREATE_ASM_SERVER_DETAILS);
//			mydb.execSQL(CREATE_ASM_DBLIST);
//			mydb.execSQL(CREATE_ASM_FORDDET);
//			mydb.execSQL(CREATE_ASM_FORDHED);
//			mydb.execSQL(CREATE_ASM_FAREA);
//			mydb.execSQL(CREATE_ASM_FLOCATION);
//			mydb.execSQL(CREATE_ASM_FINVHED);
//			mydb.execSQL(CREATE_ASM_FINVDET);
//			mydb.execSQL(CREATE_ASM_FINVFREEISS);
//			mydb.execSQL(CREATE_ASM_FDEBTOR);
//			mydb.execSQL(CREATE_ASM_FPROVINCE);
//			mydb.execSQL(CREATE_ASM_FDAYNPRDHED);
//			mydb.execSQL(CREATE_ASM_FDAYNPRDDET);
//			mydb.execSQL(CREATE_ASM_FDAYEXPDET);
//			mydb.execSQL(CREATE_ASM_FEXPENCES);   
//			mydb.execSQL(CREATE_ASM_FSALREP);
//			mydb.execSQL(CREATE_ASM_FDEALER);
//			mydb.execSQL(CREATE_ASM_FREGION);
//			mydb.execSQL(CREATE_ASM_FROUTE);
//			mydb.execSQL(CREATE_ASM_FASE);
//			mydb.execSQL(CREATE_ASM_FINVRHED);
//			mydb.execSQL(CREATE_ASM_FINVRDET);
//			mydb.execSQL(CREATE_ASM_FITENRDET);
//			mydb.execSQL(CREATE_ASM_FREASON);
//			mydb.execSQL(CREATE_ASM_FCOMPANYSETTING);
//			mydb.execSQL(CREATE_ASM_FCOMPANYBRANCH);
//			mydb.execSQL(CREATE_ASM_USERSETTINGS);
//			mydb.execSQL(CREATE_ASM_FAVHED);
//			mydb.execSQL(CREATE_ASM_FAVDET);
//			mydb.execSQL(CREATE_ASM_FBRAND);
//			mydb.execSQL(CREATE_ASM_FGROUP);
//			mydb.execSQL(CREATE_ASM_FROUTEDET);
//			mydb.execSQL(CREATE_ASM_AVTEMP);
//			mydb.execSQL(CREATE_ASM_EXPTEMP);
		} catch (Exception e) {
			// TODO: handle exception
		}
	}

}
